<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<!-- 引入bootstrap的css\js文件 -->
<link href="http://localhost:8081/zufangwang/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="http://localhost:8081/zufangwang/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://localhost:8081/zufangwang/js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="http://localhost:8081/zufangwang/laypage/laypage.js"></script>
</head>
<body>
	<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<ul class="nav nav-tabs">
				<li class="active">
					 <a href="user_intoUserRegister.do">注册</a>
				</li>
				<li>
					 <a href="user_intoUserLogin.do">登录</a>
				</li>
				<li>
					<a href="house_insertintoHouse.do">新增房屋</a>
				</li>
			</ul>
			<h3 class="text-left">
				查询条件：
			</h3>
			<form role="form" class="form-inline">
				<div class="form-group">
					 <label for="exampleInputEmail1">Email address</label><input type="email" class="form-control" id="exampleInputEmail1" />
				</div>
				<div class="form-group">
					 <label for="exampleInputPassword1">Password</label><input type="password" class="form-control" id="exampleInputPassword1" />
				</div>
				<div class="form-group">
					 <label for="exampleInputFile">File input</label><input type="file" id="exampleInputFile" />
					<p class="help-block">
						Example block-level help text here.
					</p>
				</div>
				<div class="checkbox">
					 <label><input type="checkbox" />Check me out</label>
				</div> <button type="submit" class="btn btn-default">Submit</button>
			</form>
			<table class="table table-bordered table-hover">
				<hr />
				<tbody id="two">
					
				</tbody>
			</table>
			<div id="fenye"></div>
		</div>
	</div>
	<div class="row clearfix">
		<div class="col-md-12 column">
		</div>
	</div>
</div>
	<div class="container">
		<div>
			<ul class="nav breadcrumb">
				<li class="active"><a href="user_intoUserRegister.do">注册</a></li>
				<li><a href="user_intoUserLogin.do">登录</a></li>
			</ul>
		</div>
		<div>
			<#if u_name??>
				登录的用户名：${u_name}
			<#else>
				还未登录
			</#if>
			
			<div><a href="user_intoUserRegister.do">注册</a>
			<a href="user_intoUserLogin.do">登录</a></div>
		</div>
		<div>
			<a href="house_insertintoHouse.do">新增房屋</a>
		</div>
		<div >
	 			<table class="table" >
	 				
	 			</table>
	 	</div>
	 	<div id="fenye"></div>
		<input type="button" id="one" value="111" onclick="f1()">
	</div>
	<script type="text/javascript">
		var search =function(currentPage){
 				var urls="index/house_getCurrentPageHouse.do";
 			 	$.ajax({
 			 		url:urls,
 			 		type:"post",
 			 		data:{"currentPage":currentPage},
 			 		dataTpye:"json",
 			 		success:function(result){
 			 		$("#two").html("");
 			 		$.each(result.list,function(index,item){
 			 			console.log(item);
 			 			$("#two").append("<tr><td rowspan='3'><a href='#'><img src='http://localhost:8081/zufangwang/upload/"+item.h_pic+"'</a></td><td><a href='#'>"+item.h_title+"</a></td><td rowspan='3'>"+item.h_money+"元/月</td></tr><tr class='success'><td>"+item.h_rooms+"室"+item.h_ting+"厅"+item.h_wei+"卫</td></tr><tr class='error'><td>"+item.h_floor+"楼</td></tr>")
 			 			//$("#two").append("<tr class=active><td><img src='http://localhost:8081/zufangwang/upload/"+item.h_pic+"'</td><td>"+item.h_title+"</td></tr>")
 			 		});
 			 		//laypage放在success函数内
 			 		laypage({
 			 			cont : 'fenye',  //容器id：存放分页
 			 			pages : result.totalPage, //得到总页数
 			 			curr:  result.currentPage || 1,  //当前页
 			 			skip: true, //是否开启跳页
 			 			skin: '#AF0000',  //页码的颜色
 			 			groups: 10,  //分组
 			 			jump : function(obj, first) {
 			 				if (!first) {   //首次加载不执行，并传递当前页：obj.curr
 			 						search(obj.curr);  //调用函数
 			 							}
 			 				}
 			 		}); 
 			 		}
 			 		})
 			}
 			search(1);
		function f1(){
			alert(1232);
		}
	</script>
</body>
</html>